
function getServiceAPi(sid, api_id,req_head,resp_head) {
	// 服务下没有API的时候，API按钮不可点击
	if (api_id == 0) {
		return;
	}

	$("#api_list_id div a").each(function(i) {
		$(this).removeClass('hr');
	});

	$('#api_list_' + api_id + '').addClass('hr');
	
	        var req_head = $("#req_head").val();
	        var resp_head = $("#resp_head").val();
	        
			$.ajax({
				url : '/apiworks/getServiceApi.html',
				type : 'GET',
				dataType : 'json',
				async : true,
				data : {
					'service_id' : sid,
					'apiid' : api_id
				},
				success : function(req) {
					if (req.status == 200) {
						if(req_head!=''){
							req.apidata.service_request_heads = JSON.parse( req_head);
						}
						if(resp_head!=''){
							req.apidata.service_response_heads = JSON.parse( resp_head );
						}
						
						var html = template('service_api_id', req.apidata);
						document.getElementById('service_api_info_content').innerHTML = html;
						require.async(["apiservice:api.js"], function(mod){
					          mod.init();
					    });
					} else {
						show_msg({msg:req.msg,type:'error',time:2000});
					}
					return false;
				},
				error : function() {
					show_msg({msg:'系统异常',type:'error',time:2000});
				}
			});
			
}